//
// Tables
// --------------------------------------------------


table
  border-collapse: collapse
  background-color: table-bg
caption
  padding-top: table-cell-padding
  padding-bottom: table-cell-padding
  text-align: left
th
  text-align: left

// Baseline styles

table
  width: 100%
  max-width: 100%
  // Cells
  > thead,
  > tbody,
  > tfoot
    > tr
      > th,
      > td
        padding: table-cell-padding
        line-height: table-line-height
        vertical-align: top
        border-top: 1px solid table-border-color
  // Bottom align for column headings
  > thead > tr > th
    vertical-align: bottom
    border-bottom: 2px solid table-border-color
  // Remove top border from thead by default
  > caption + thead,
  > colgroup + thead,
  > thead:first-child
    > tr:first-child
      > th,
      > td
        border-top: 0;
  // Account for multiple tbody instances
  > tbody + tbody
    border-top: 2px solid table-border-color

// Bordered version
//
// Add borders all around the table and between all the columns.

table
  border: 1px solid table-border-color
  > thead,
  > tbody,
  > tfoot
    tr
      > th,
      > td
        border: 1px solid table-border-color;
  > thead > tr
    > th,
    > td
      border-bottom-width: 2px;

// Zebra-striping
//
// Default zebra-stripe styles (alternating gray and transparent backgrounds)

table 
  > tbody > tr:nth-of-type(odd)
    background-color: table-bg-accent
